package com.bjpowernode.pmes.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Select;

import com.bjpowernode.pmes.bean.User;

public interface UserDao {

	@Select("select * from t_user where usercode = #{usercode}")
	User getUserByCode(String usercode);

	int insertUser(User user);

	@Select("select * from t_user order by createtime desc limit #{startIndex}, #{pagesize}")
	List<User> getAllUserList(Map<String, Object> paramMap);

	@Select("select count(*) from t_user")
	Integer getUsersCount();

	@Select("select * from t_user where id = #{id}")
	User getUserById(Integer id);

	int updateUser(User user);

	int deleteUsers(Map<String, Object> paramMap);

	@Select("select * from t_user where loginacct = #{loginacct} and userpswd = #{userpswd}")
	User getUserForLogin(User user);

}
